<div id="tab11" class="tab">
    <div class="tab-labels">
        <div class="xian"></div>
        补偿款信息
    </div>
    <div id="shoukuans">
        <input type="hidden" name="id" value="{$row.id}">
        <input type="hidden" value="{$row.id}" id="bid">
        <div class="conts">
            <div class="input">
                <span>被服务人</span>
                <input type="text" placeholder="被服务人" name="learned_name" value="{$row.learned_name}">
            </div>
            <div class="input">
                <span>证件类型</span>
                <select name="learned_kind">
                    <option value="0" {if condition="$row['learned_kind'] eq 0"}selected{else/}''{/if}>身份证</option>
                    <option value="1" {if condition="$row['learned_kind'] eq 1"}selected{else/}''{/if}>统一社会信用代码</option>
                </select>
            </div>
            <div class="input">
                <span>证件号</span>
                <input type="text" placeholder="证件号" value="{$row.learned_card}" name="learned_card">
            </div>
            <div class="input">
                <span>电话</span>
                <input type="text" placeholder="电话" value="{$row.learned_phone}" name="learned_phone">
            </div>
        </div>
        <div class="conts">
            <input type="button" name="Submit" value="增加" onclick="AddRow31(document.getElementById('tabProducts4'),1)" style="padding: 5px 10px;height:30px;border: none;background:#1b4fe7;color: #fff;"/>
            <input type="button" name="Submit2" value="删除" onclick="DeleteRow1(document.getElementById('tabProducts4'),1)" style="padding: 5px 10px;height:30px;border: none;background:#1b4fe7;color: #fff;"/>
<!--            <input type="button" onclick="shoukuan(this)" value="保存数据" style="padding: 5px 10px;height:30px;border: none;background:#1b4fe7;color: #fff;">-->

            <table class="layui-table" id="tabProducts4">
                <tr style="background:#4e73df;color: #fff;" class="ys">
                    <td style="width: 66px">选择</td>
                    <td>收款人</td>
                    <td>证件类型</td>
                    <td>证件号</td>
                    <td>电话</td>
                    <td>与被服务人关系</td>
                    <td>开户行</td>
                    <td>账号</td>
                    <td>金额</td>
                </tr>
                {empty name="shoukuan"}
<!--                <tr>-->
<!--                    <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id" class="shoukuanid" value=""></td>-->
<!--                    <td><input type="text" name="shoukuan_ren" class="shoukuan_ren"></td>-->
<!--                    <td><input type="text" name="shoukuan_kind" class="shoukuan_kind" list="shoukuan_kind">-->
<!--                        <datalist id="shoukuan_kind">-->
<!--                            <option value="身份证">身份证</option>-->
<!--                            <option value="统一社会信用代码">统一社会信用代码</option>-->
<!--                        </datalist></td>-->
<!--                    <td><input type="text" name="shoukuan_card" class="shoukuan_card"></td>-->
<!--                    <td><input type="text" name="shoukuan_phone" class="shoukuan_phone"></td>-->
<!--                    <td><input type="text" name="shoukuan_relation" class="shoukuan_relation"></td>-->
<!--                    <td><input type="text" name="shoukuan_bank" class="shoukuan_bank"></td>-->
<!--                    <td><input type="text" name="shoukuan_account" class="shoukuan_account"></td>-->
<!--                    <td><input type="text" name="shoukuan_money" class="shoukuan_money"></td>-->
<!--                </tr>-->
                {/empty}
                {volist name="shoukuan" id="vo"}
                <tr>
                    <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id" class="shoukuanid" value="{$vo.id}"></td>
                    <td><input type="text" name="shoukuan_ren" class="shoukuan_ren" value="{$vo.ren}"></td>
                    <td><input type="text" name="shoukuan_kind" class="shoukuan_kind" value="{$vo.kind}" list="shoukuan_kinds">
                        <datalist id="shoukuan_kinds">
                            <option value="身份证">身份证</option>
                            <option value="统一社会信用代码">统一社会信用代码</option>
                        </datalist></td>
                    <td><input type="text" name="shoukuan_card" class="shoukuan_card" value="{$vo.card}"></td>
                    <td><input type="text" name="shoukuan_phone" class="shoukuan_phone" value="{$vo.phone}"></td>
                    <td><input type="text" name="shoukuan_relation" class="shoukuan_relation" value="{$vo.relation}"></td>
                    <td><input type="text" name="shoukuan_bank" class="shoukuan_bank" value="{$vo.bank}"></td>
                    <td><input type="text" name="shoukuan_account" class="shoukuan_account" value="{$vo.account}"></td>
                    <td><input type="text" name="shoukuan_money" class="shoukuan_money" value="{$vo.money}"></td>
                </tr>
                {/volist}
            </table>
        </div>
    </div>
    <script>
        function DeleteRow1(table, index){

            for(var i=table.rows.length - 1; i>0;i--){
                var chkOrder =table.rows[i].cells[0].firstChild;
                if(chkOrder){
                    if(chkOrder.type = "CHECKBOX"){
                        if(chkOrder.checked){
                            //执行删除
                            table.deleteRow(i);
                        }
                    }
                }
            }
        }
        function shoukuan(btn){
            layer.confirm('请确认是否已填完数据', {
                icon: 3
            }, function (index) {
                var ids = $('.shoukuanid');
                var rens = $('.shoukuan_ren');
                var kinds = $('.shoukuan_kind');
                var cards = $('.shoukuan_card');
                var phones = $('.shoukuan_phone');
                var relations = $('.shoukuan_relation');
                var banks = $('.shoukuan_bank');
                var accounts = $('.shoukuan_account');
                var moneys = $('.shoukuan_money');
                var bids = $('#bid');
                var id = new Array();
                var ren = new Array();
                var kind = new Array();
                var card = new Array();
                var phone = new Array();
                var relation = new Array();
                var bank = new Array();
                var account = new Array();
                var money = new Array();
                var bid = bids.val();
                for (var i = 0; i< ids.length;i++){
                    id[i] = ids[i].value;
                }
                for (var i = 0; i < rens.length; i++) {
                    if(rens[i].value == ""){
                        layer.msg('收款人禁止为空');
                        return false;
                    }
                    ren[i] = rens[i].value;
                }
                for (var i = 0; i < kinds.length; i++) {
                    kind[i] = kinds[i].value;
                }
                for (var i = 0; i < cards.length; i++) {
                    card[i] = cards[i].value;
                }
                for (var i = 0; i < phones.length; i++) {
                    phone[i] = phones[i].value;
                }
                for (var i = 0; i < relations.length; i++) {
                    relation[i] = relations[i].value;
                }
                for (var i = 0; i < banks.length; i++) {
                    bank[i] = banks[i].value;
                }
                for (var i = 0; i < accounts.length; i++) {
                    account[i] = accounts[i].value;
                }
                for (var i = 0;i < moneys.length; i++){
                    money[i] =  moneys[i].value;
                }


                $.ajax({
                    url: "{:url('bushen/lisuan/shoukuan')}",
                    data: {
                        id:id,
                        ren: ren,
                        kind: kind,
                        card: card,
                        phone: phone,
                        relation: relation,
                        bank: bank,
                        account: account,
                        money:money,
                        bid: bid,
                        sid:"{$orderid}"
                    },
                    type: 'post',
                    dataType: 'json',
                    success: function (res) {
                        layer.msg(res.msg);
                        btn.onclick = '';
                    }
                })
            });
        }

        function shoukuan1(){
            var ids = $('.shoukuanid');
            var rens = $('.shoukuan_ren');
            var kinds = $('.shoukuan_kind');
            var cards = $('.shoukuan_card');
            var phones = $('.shoukuan_phone');
            var relations = $('.shoukuan_relation');
            var banks = $('.shoukuan_bank');
            var accounts = $('.shoukuan_account');
            var moneys = $('.shoukuan_money');
            var bids = $('#bid');
            var id = new Array();
            var ren = new Array();
            var kind = new Array();
            var card = new Array();
            var phone = new Array();
            var relation = new Array();
            var bank = new Array();
            var account = new Array();
            var money = new Array();
            var bid = bids.val();
            for (var i = 0; i< ids.length;i++){
                id[i] = ids[i].value;
            }
            for (var i = 0; i < rens.length; i++) {
                if(rens[i].value == ""){
                    layer.msg('收款人禁止为空');
                    return false;
                }
                ren[i] = rens[i].value;
            }
            for (var i = 0; i < kinds.length; i++) {
                kind[i] = kinds[i].value;
            }
            for (var i = 0; i < cards.length; i++) {
                card[i] = cards[i].value;
            }
            for (var i = 0; i < phones.length; i++) {
                phone[i] = phones[i].value;
            }
            for (var i = 0; i < relations.length; i++) {
                relation[i] = relations[i].value;
            }
            for (var i = 0; i < banks.length; i++) {
                bank[i] = banks[i].value;
            }
            for (var i = 0; i < accounts.length; i++) {
                account[i] = accounts[i].value;
            }
            for (var i = 0;i < moneys.length; i++){
                money[i] =  moneys[i].value;
            }
            $.ajax({
                url: "{:url('bushen/lisuan/shoukuan')}",
                data: {
                    id:id,
                    ren: ren,
                    kind: kind,
                    card: card,
                    phone: phone,
                    relation: relation,
                    bank: bank,
                    account: account,
                    money:money,
                    bid: bid,
                    sid:"{$orderid}"
                },
                type: 'post',
                dataType: 'json',
                success: function (res) {
                    if(res.code != 1){
                        layer.msg(res.msg);
                        return false;
                    }

                }
            })
        }
        function dels4(){
            var id = '';
            $('.shoukuanid').each(function(){
                if($(this).is(':checked')){
                    id += ','+$(this).val();
                }
            })
            id=id.substring(1);
            $.ajax({
                url:"{:url('buchang/deletes')}",
                data:{id:id,type:'shoukuan'},
                type:'post',
                dataType:'json',
                success:function(res){
                    location.reload();
                }
            })
        }
    </script>
    <script>
        function test5(){
            var div4=document.getElementById("shoukuans");
            if(div4.style.display=="block"){
                div4.style.display="none";
            }else{
                div4.style.display="block";
            }
        }
    </script>
    <div class="titles" onclick="test6()">
        <p><font></font>其他费用信息</p>
    </div>
    <div id="qitas">
        <input type="hidden" name="id" value="{$row.id}">
        <div class="conts">
            <input type="button" name="Submit" value="增加" onclick="AddRow31(document.getElementById('tabProducts6'),1)" style="padding: 5px 10px;height:30px;border: none;background:#1b4fe7;color: #fff;"/>
            <input type="button" name="Submit2" value="删除" onclick="DeleteRow1(document.getElementById('tabProducts6'),1)" style="padding: 5px 10px;height:30px;border: none;background:#1b4fe7;color: #fff;"/>
<!--            <input type="button" onclick="qita(this)" value="保存数据" style="padding: 5px 10px;height:30px;border: none;background:#1b4fe7;color: #fff;">-->

            <table class="layui-table" id="tabProducts6">
                <tr style="background:#4e73df;color: #fff;" class="ys">
                    <td style="width: 66px">选择</td>
                    <td>收款人</td>
                    <td>证件类型</td>
                    <td>证件号</td>
                    <td>电话</td>
                    <td>与被服务人关系</td>
                    <td>开户行</td>
                    <td>账号</td>
                    <td>金额</td>
                </tr>
                {empty name="qita"}
<!--                <tr>-->
<!--                    <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id" class="qitaid" value=""></td>-->
<!--                    <td><input type="text" name="qita_ren" class="qita_ren"></td>-->
<!--                    <td><input type="text" name="qita_kind" class="qita_kind" list="qita_kind">-->
<!--                        <datalist id="qita_kind">-->
<!--                            <option value="身份证">身份证</option>-->
<!--                            <option value="统一社会信用代码">统一社会信用代码</option>-->
<!--                        </datalist></td>-->
<!--                    <td><input type="text" name="qita_card" class="qita_card"></td>-->
<!--                    <td><input type="text" name="qita_phone" class="qita_phone"></td>-->
<!--                    <td><input type="text" name="qita_relation" class="qita_relation"></td>-->
<!--                    <td><input type="text" name="qita_bank" class="qita_bank"></td>-->
<!--                    <td><input type="text" name="qita_account" class="qita_account"></td>-->
<!--                    <td><input type="text" name="qita_money" class="qita_money"></td>-->
<!--                </tr>-->
                {/empty}
                {volist name="qita" id="vo"}
                <tr>
                    <td><input type="checkbox" style="width: 15px;height: 15px;display: block;" name="id" class="qitaid" value="{$vo.id}"></td>
                    <td><input type="text" name="qita_ren" class="qita_ren" value="{$vo.ren}"></td>
                    <td><input type="text" name="qita_kind" class="qita_kind" value="{$vo.kind}" list="qita_kinds">
                        <datalist id="qita_kinds">
                            <option value="身份证">身份证</option>
                            <option value="统一社会信用代码">统一社会信用代码</option>
                        </datalist></td>
                    <td><input type="text" name="qita_card" class="qita_card" value="{$vo.card}"></td>
                    <td><input type="text" name="qita_phone" class="qita_phone" value="{$vo.phone}"></td>
                    <td><input type="text" name="qita_relation" class="qita_relation" value="{$vo.relation}"></td>
                    <td><input type="text" name="qita_bank" class="qita_bank" value="{$vo.bank}"></td>
                    <td><input type="text" name="qita_account" class="qita_account" value="{$vo.account}"></td>
                    <td><input type="text" name="qita_money" class="qita_money" value="{$vo.money}"></td>
                </tr>
                {/volist}
            </table>
        </div>
        <script>
            function test6(){
                var div4=document.getElementById("qitas");
                if(div4.style.display=="block"){
                    div4.style.display="none";
                }else{
                    div4.style.display="block";
                }
            }
        </script>
        <script>
            function qita(btn){
                layer.confirm('请确认是否已填完数据', {
                    icon: 3
                }, function (index) {
                    var ids = $('.qitaid');
                    var rens = $('.qita_ren');
                    var kinds = $('.qita_kind');
                    var cards = $('.qita_card');
                    var phones = $('.qita_phone');
                    var relations = $('.qita_relation');
                    var banks = $('.qita_bank');
                    var accounts = $('.qita_account');
                    var moneys = $('.qita_money');
                    var bids = $('#bid');
                    var id = new Array();
                    var ren = new Array();
                    var kind = new Array();
                    var card = new Array();
                    var phone = new Array();
                    var relation = new Array();
                    var bank = new Array();
                    var account = new Array();
                    var money = new Array();
                    var bid = bids.val();
                    for (var i = 0; i< ids.length;i++){
                        id[i] = ids[i].value;
                    }
                    for (var i = 0; i < rens.length; i++) {
                        if(rens[i].value == ""){
                            layer.msg('收款人禁止为空');
                            return false;
                        }
                        ren[i] = rens[i].value;
                    }
                    for (var i = 0; i < kinds.length; i++) {
                        kind[i] = kinds[i].value;
                    }
                    for (var i = 0; i < cards.length; i++) {
                        card[i] = cards[i].value;
                    }
                    for (var i = 0; i < phones.length; i++) {
                        phone[i] = phones[i].value;
                    }
                    for (var i = 0; i < relations.length; i++) {
                        relation[i] = relations[i].value;
                    }
                    for (var i = 0; i < banks.length; i++) {
                        bank[i] = banks[i].value;
                    }
                    for (var i = 0; i < accounts.length; i++) {
                        account[i] = accounts[i].value;
                    }
                    for (var i = 0; i < moneys.length;i++){
                        money[i] = moneys[i].value;
                    }
                    $.ajax({
                        url: "{:url('bushen/lisuan/qita')}",
                        data: {
                            id:id,
                            ren: ren,
                            kind: kind,
                            card: card,
                            phone: phone,
                            relation: relation,
                            bank: bank,
                            account: account,
                            money:money,
                            bid: bid,
                            sid:"{$orderid}"
                        },
                        type: 'post',
                        dataType: 'json',
                        success: function (res) {
                            layer.msg(res.msg);
                            btn.onclick = '';
                        }
                    })
                });
            }
            function qita1(){
                var ids = $('.qitaid');
                var rens = $('.qita_ren');
                var kinds = $('.qita_kind');
                var cards = $('.qita_card');
                var phones = $('.qita_phone');
                var relations = $('.qita_relation');
                var banks = $('.qita_bank');
                var accounts = $('.qita_account');
                var moneys = $('.qita_money');
                var bids = $('#bid');
                var id = new Array();
                var ren = new Array();
                var kind = new Array();
                var card = new Array();
                var phone = new Array();
                var relation = new Array();
                var bank = new Array();
                var account = new Array();
                var money = new Array();
                var bid = bids.val();
                for (var i = 0; i< ids.length;i++){
                    id[i] = ids[i].value;
                }
                for (var i = 0; i < rens.length; i++) {
                    if(rens[i].value == ""){
                        layer.msg('收款人禁止为空');
                        return false;
                    }
                    ren[i] = rens[i].value;
                }
                for (var i = 0; i < kinds.length; i++) {
                    kind[i] = kinds[i].value;
                }
                for (var i = 0; i < cards.length; i++) {
                    card[i] = cards[i].value;
                }
                for (var i = 0; i < phones.length; i++) {
                    phone[i] = phones[i].value;
                }
                for (var i = 0; i < relations.length; i++) {
                    relation[i] = relations[i].value;
                }
                for (var i = 0; i < banks.length; i++) {
                    bank[i] = banks[i].value;
                }
                for (var i = 0; i < accounts.length; i++) {
                    account[i] = accounts[i].value;
                }
                for (var i = 0; i < moneys.length;i++){
                    money[i] = moneys[i].value;
                }
                $.ajax({
                    url: "{:url('bushen/lisuan/qita')}",
                    data: {
                        id:id,
                        ren: ren,
                        kind: kind,
                        card: card,
                        phone: phone,
                        relation: relation,
                        bank: bank,
                        account: account,
                        money:money,
                        bid: bid,
                        sid:"{$orderid}"
                    },
                    type: 'post',
                    dataType: 'json',
                    success: function (res) {
                        if(res.code != 1){
                            layer.msg(res.msg);
                            return false;
                        }

                    }
                })
            }
            function dels5(){
                var id = '';
                $('.qitaid').each(function(){
                    if($(this).is(':checked')){
                        id += ','+$(this).val();
                    }
                })
                id=id.substring(1);
                $.ajax({
                    url:"{:url('buchang/deletes')}",
                    data:{id:id,type:'qita'},
                    type:'post',
                    dataType:'json',
                    success:function(res){
                        console.log(res);
                        location.reload();
                    }
                })
            }
        </script>
    </div>
</div>